<%@ page import="com.zafu.entity.StoreInfo" %>
<%@ page import="com.zafu.dao.StoreBean" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %><%--
  Created by IntelliJ IDEA.
  User: 86189
  Date: 2024/12/2
  Time: 10:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    StoreBean bean = new StoreBean();
    ArrayList<StoreInfo> data = bean.GetAll();
    StringBuilder builder = new StringBuilder();
    out.println("<Stores>");
    Iterator<StoreInfo> iter = data.iterator();
    while (iter.hasNext()) {
        StoreInfo info = iter.next();
        builder.append(info.toString()).append("\n");

        out.println("<Store>");
        out.println("<id>" + info.getId() + "</id>");
        out.println("<image>" + info.getImage() + "</image>");
        out.println("<name>" + info.getName() + "</name>");
        out.println("<deliveryTime>" + info.getDeliveryTime() + "</deliveryTime>");
        out.println("<distance>" + info.getDistance() + "</distance>");
        out.println("<rating>" + info.getRating() + "</rating>");
        out.println("<sales>" + info.getSales() + "</sales>");
        out.println("<minPrice>" + info.getMinPrice() + "</minPrice>");
        out.println("<deliveryCost>" + info.getDeliveryCost() + "</deliveryCost>");
        out.println("<recommend>" + info.getRecommend() + "</recommend>");
        out.println("<campusSend>" + info.getCampusSend() + "</campusSend>");
        out.println("</Store>");
    }
    out.println("</Stores>");
    System.out.printf(builder.toString());
%>
